namespace Aurora.Discovery.HttpClient.Abstractions;

/// <summary>
/// 服务发现参数
/// </summary>
public class DiscoveryOptions
{
    public DiscoveryOptions()
    {
        Extensions = new List<IDiscoveryOptionsExtension>();
    }
    /// <summary>
    /// 扩展的参数服务
    /// </summary>
    public IList<IDiscoveryOptionsExtension> Extensions { get; }

    /// <summary>
    /// Registers an extension that will be executed when building services.
    /// </summary>
    /// <param name="extension"></param>
    public void RegisterExtension(IDiscoveryOptionsExtension extension)
    {
        if (extension == null) throw new ArgumentNullException(nameof(extension));

        Extensions.Add(extension);
    }
}